<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;
use app\model\BaseModel;
/**
 * @mixin \think\Model
 */
class ActivityList extends BaseModel
{
   //开启自动写入时间戳字段
   protected $autoWriteTimestamp = true;
   // 定义时间戳字段名
   protected $createTime = 'add_time';
   protected $updateTime = 'update_time';

   public function searchActivityNameAttr($query, $value)
    {
        if($value){
            $query->where('activity_name' , 'like', "%". $value . '%');
        }
    } 

    public function searchStatusAttr($query, $value)
    {
        if($value){
            $query->where('status' , $value);
        }
    } 
    
}
